import type { RouteRecordRaw } from "vue-router"
import Layout from "@/components/Layout/index.vue"

// interface Meta {
//   title: string, // 标题
//   icon?: string, // 图标
//   isHide?: boolean, // 代表路由在菜单中是否隐藏，是否隐藏[0隐藏，1显示]
//   isLink?: boolean, // 是否外链[有值则是外链]
//   isKeepAlive?: boolean, // 是否缓存路由数据[0是，1否]
// }
// 菜单栏显示的路由
export const views: RouteRecordRaw[] = [
  {
    path: "/",
    component: Layout,
    meta: { title: "首页" },
    redirect: "/home/home",
    children: [
      {
        path: '/home/home',
        name: "home",
        component: () => import('@/views/home/home.vue'),
        meta: { title: "首页" }
      },
    ]
  },
  {
    path: '/goods',
    component: Layout,
    meta: { title: "商品管理",icon:"Goods" },
    redirect: "/goods/goodsList",
    children: [
      {
        path: '/goods/goodsList',
        name: "goodsList",
        component: () => import('@/views/goods/goodsList/goodsList.vue'),
        meta: { title: "商品列表" , icon:"List"}
      },
      {
        path: '/goods/category',
        name: "category",
        component: () => import('@/views/goods/category/category.vue'),
        meta: { title: "商品分类",icon:"Box" }
      },
    ]
  },
  {
    path: '/order',
    component: Layout,
    meta: { title: "订单管理" },
    redirect: "/order/orderList",
    children: [
      {
        path: '/order/orderList',
        name: "orderList",
        component: () => import('@/views/order/orderList/orderList.vue'),
        meta: { title: "订单列表",icon:"List" }
      }
    ]
  },
  {
    path: '/member',
    component: Layout,
    meta: { title: "会员管理" },
    redirect: "/member/memberList",
    children: [
      {
        path: '/member/memberList',
        name: "memberList",
        component: () => import('@/views/member/memberList/memberList.vue'),
        meta: { title: "会员列表",icon:"List" }
      }
    ]
  }
]